﻿<%@ Page Title="Search" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Search.aspx.cs" Inherits="PublSystem.Search" %>

<asp:Content ID="Search" ContentPlaceHolderID="MainContent" runat="server">
    <p></p>
    <p>Search by author:</p>
    <asp:TextBox ID="textSearchByAuthor" runat="server" CssClass="form-control" Height="32px" Width="483px"></asp:TextBox>
    <asp:Button ID="buttonSearchByAuthor" runat="server" Text="Search" class="btn btn-default" OnClick="buttonSearchByAuthor_Click" />
    <p>Search by content:</p>
    <asp:TextBox ID="textSearchByContent" runat="server" CssClass="form-control" Height="32px" Width="483px"></asp:TextBox>
    <asp:Button ID="buttonSearchByContent" runat="server" Text="Search" class="btn btn-default" OnClick="buttonSearchSearchByContent_Click" />
    <p>Search by keyword:</p>
    <asp:TextBox ID="textSearchByKeyword" runat="server" CssClass="form-control" Height="32px" Width="483px"></asp:TextBox>
    <asp:Button ID="buttonSearchByKeyword" runat="server" Text="Search" class="btn btn-default" OnClick="buttonSearchByKeyword_Click" />
    <asp:Repeater ID="publs" runat="server">
        <ItemTemplate>
            <h3><b>
                <asp:Label ID="txtTitle" runat="server" Text='<%# "<a href=\"Publication?id=" + Eval("publicationId") + "\">"+ Eval("title") + "</a>" %>' /></b></h3>
            Link:
            <asp:Label ID="txtLink" runat="server" Text='<%# "<a href=\"" + (Eval("link").ToString() == "Publication?id=" ? "Publication?id="+ Eval("publicationId") : Eval("link")) + "\">" + (Eval("link").ToString() == "Publication?id=" ? "Publication?id="+ Eval("publicationId") : Eval("link")) + "</a>" %>' /><br />
            Published:
            <asp:Label ID="txtPublished" runat="server" Text='<%# String.Format("{0:d}", Eval("published")) %>' /><br />
            <p>Updated:
                <asp:Label ID="txtUpdated" runat="server" Text='<%# String.Format("{0:d}", Eval("updated")) %>' /></p>
                        <p><asp:Label ID="Label1" class="btn btn-default" runat="server" Text='<%# "<a href=\"Delete?article=" + Eval("publicationId") + "\">Delete</a>" %>' /> <asp:Label ID="EditLbl" class="btn btn-default" runat="server" Text='<%# "<a href=\"Edit?id=" + Eval("publicationId") + "\">Edit</a>" %>' /></p>
               <p> <asp:Label ID="txtSummary" runat="server" Text='<%# Eval("summary") %>' /></p>
        </ItemTemplate>
    </asp:Repeater>

</asp:Content>
